<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="css/style.css">
    <script src="js/jquery-1.10.2.min.js"></script>
</head>
<body>
<!--main-header start-->
<div class="main-header">
    <div class="w-1200 clearfix">
        <div class="header-logo fl"><a href=""><img src="images/logo.png"></a> </div>
        <!--header-person start-->
        <div class="header-person fr">
            <div id="head_login"></div>
    <script type="text/javascript">
      
      $("#head_login").load("login_common.html");
    </script>
        </div>
        <!--header-person end-->
        <!--header-nav start-->
        <div class="header-nav fr">
            <ul class="nav">
                <li class="on"><a href="/user1.html">用户列表</a> </li>
                <li><a href="/user4.html">新增用户</a> </li>
            </ul>
        </div>
        <!--header-nav end-->
    </div>
</div>
<!--main-header end-->
<!--policy-head start-->
<div class="policy-head w-1200">
    <a class="policy-head-a" href="/user1.html">个人用户列表</a>
    <a class="policy-head-a on" href="/user12.html">组织用户列表</a>
   
</div>
<!--policy-head end-->
<!--head-search start-->
<div id="mainbox">
    <div class="head-search user-head  w-1200">
        <div class="head-search-box clearfix">
            <!--head-search-li start-->
            <div class="head-search-li">
                <div class="li-con">
                    <div class="label">姓名:</div>
                    <div class="input"><input class="text" type="text" id="name"></div>
                </div>
            </div>
            <!--head-search-li end-->
            <!--head-search-li start-->
            <div class="head-search-li">
                <div class="li-con">
                    <div class="label">身份证号：</div>
                    <div class="input"><input class="text" id="idnumber" type="text"></div>
                </div>
            </div>
            <!--head-search-li end-->
            <!--head-search-li start-->
            <div class="head-search-li">
                <div class="li-con">
                    <div class="label">评审等级：</div>
                    <div class="input">
                        <select id="level" name="salary">
                           
                        </select>
                    </div>
                </div>
            </div>
            <!--head-search-li end-->
            <!--head-search-li start-->
            <!-- <div class="head-search-li">
                <div class="li-con">
                    <div class="label">评审等级:</div>
                    <div class="input"><input class="text" type="text"></div>
                </div>
            </div> -->
            <!--head-search-li end-->
            <!--head-search-li start-->
            <div class="head-search-li">
                <div class="li-con">
                    <div class="label">添加时间：</div>
                    <div class="input">
                        <input type="date" id="addtime" class='text edit-input ECalendar'  placeholder="请选择时间"	/>
                    </div>
                </div>
            </div>
            <!--head-search-li end-->
            <!--head-search-li start-->
            <div class="head-search-li">
                <div class="li-con">
                    <div class="label">状态：</div>
                    <div class="input">
                        <select id="status" name="salary">
                            <option value="all">全部</option>
                            <option value="1">正常</option>
                            <option value="0">删除</option>
                          
                        </select>
                    </div>
                </div>
            </div>
            <!--head-search-li end-->
            <div class="head-search-but fr">
                <button class="login-btn fr" onclick="search()">立即搜索</button>
            </div>
        </div>
     </div>
<!--head-search end-->
<link rel="stylesheet" href="js/date/date.css">
<script src="js/date/Ecalendar.jquery.min.js"></script>
<script type="text/javascript">
    $(function(){
        $("#ECalendar_case1").ECalendar({
            type:"date",
            skin:"#037d80",
            offset:[0,2]
        });
    })
</script>
<script src="js/auth.js"></script>
<script src="js/jquery.selectlist.js"></script>
<script type="text/javascript">
   
</script>
<!--project-list start-->
<div class="project-list w-1200">
    <!--project-list-head start-->
    <div class="project-list-head clearfix">
        <div class="project-list-li w-130 fl">类型</div>
        <div class="project-list-li w-200 fl">账号</div>
        <div class="project-list-li w-200 fl">信用代码证</div>
        <div class="project-list-li w-200 fl">机构名称</div>
        <div class="project-list-li w-100 fl">添加时间</div>
        <div class="project-list-li w-110 fl">状态</div>
        <div class="project-list-li w-200 fl">操作</div>
    </div>
   
   <div id="listuser"></div>
   
    <!--project-list-item end-->
    <!--main-pages start-->
    <div class="main-pages" id="pg">
        
    </div>
    <!--main-pages end-->
</div>
</div>
<script src="js/auth.js"></script>
<script>
    fillsearch();
    function loadpage(p){
    
        var name = getQueryString2("name");
        var idnumber = getQueryString2("idnumber");
        var addtime = getQueryString2("addtime");
        var level = getQueryString2("level");
        var status = getQueryString2("status");
        $.get("api/Admin/list?type=jg&p="+p+"&name="+name+"&idnumber="+idnumber+"&addtime="+addtime+"&level="+level+"&status="+status,function(res){
    
            if(res.code==200){
                var listcon = "";
    
                $.each(res.result.list,function(k,v){
    
                    var st="";
                    if(v.status==1){
                        st="正常";
                    }else{
                        st="删除";
                    }


        listcon+=`<div class="project-list-item clearfix">
        <div class="project-list-li w-130 fl">`+getusertype(v.type)+`</div>
        <div class="project-list-li w-200 fl">`+v.userAccount+`</div>
        <div class="project-list-li w-200 fl">`+v.xydmz+`</div>
        <div class="project-list-li w-200 fl">`+v.displayname+`</div>
        <div class="project-list-li w-100 fl">`+timestampToTime2(v.addtimestamp)+`</div>
        <div class="project-list-li w-110 fl">`+st+`</div>
        <div class="project-list-li w-200 fl">
            <a class="project-list-but xiu" href=`+"/user4.html?id="+v.id+`>修改</a>
                <a class="project-list-but del" href="#" onclick="deluser(`+v.id+`)">删除</a>
                 <a class="project-list-but scan" href=`+"/userinfo.html?id="+v.id+`>查看</a>
            
        </div>
    </div>`;
    
    
    
    
                });
    
    console.log(listcon);
                $("#listuser").html(listcon);
                $("#pg").html(res.result.pg);
    
    
    
    
            }
    
        });
    
    }
    
    
    
    loadpage(1)
    
    
    
    
    
    function jumpage(p,size){
        loadpage(p);
    }
    
    
    
    
        $("#name").val(getQueryString2('name'));
        $("#addtime").val(getQueryString2("addtime"));
         $("#idnumber").val(getQueryString2("idnumber"));  
    
         $("#level").val(getQueryString2("level"));  
         $("#status").val(getQueryString2("status"));  
    
    function search(){
    
        var name = $("#name").val();
        var idnumber = $("#idnumber").val();
        var addtime = $("#addtime").val();
        var level = $("#level").val();
    
        var status = $("#status").val();
        window.location.href = "/user12.html?name="+name+"&idnumber="+idnumber+"&addtime="+addtime+"&level="+level+"&status="+status;
    
    }
    
    

    function deluser(id){
        $.get("api/Admin/deluser?id="+id,function(res){
            if(res.code==200){
                alert("删除成功");
                window.location.reload();
            }
        });
    }
    </script>

</body>
</html>
